﻿<core:ViewBase  x:Class="DXTools.UI.Modules.JavaScriptConverter.Views.JSConverterView"
    xmlns:core="clr-namespace:DXTools.UI.Core.View;assembly=DXTools.UI.Core"
    xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    
    xmlns:layout="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Layout.Toolkit"
    xmlns:converters="clr-namespace:DXTools.UI.Core.Converters;assembly=DXTools.UI.Core"
                
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="800" Margin="5,5,15,5">
     
       
        <toolkit:BusyIndicator IsBusy="{Binding IsBusy}">
            
            
        <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>

                <RowDefinition Height="100" ></RowDefinition>
                <RowDefinition Height="33" ></RowDefinition>
            <RowDefinition></RowDefinition>
            
        </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"></ColumnDefinition>
                <ColumnDefinition Width="*"></ColumnDefinition>

                </Grid.ColumnDefinitions>

            <StackPanel Grid.Column="0" Grid.Row="0" HorizontalAlignment="Stretch" Margin="5" >
                <Grid x:Name="BrowseFile" HorizontalAlignment="Stretch">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="40"></RowDefinition>
                        <RowDefinition></RowDefinition>
                    </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="100"></ColumnDefinition>
                        <ColumnDefinition Width="*"></ColumnDefinition>
                        <ColumnDefinition Width="100"></ColumnDefinition>

                    </Grid.ColumnDefinitions>

                    <TextBlock  Grid.Row="0" Grid.Column="0" HorizontalAlignment="Stretch" Height="20" Text="JS File" FontWeight="Bold" />
                    <TextBox    Grid.Row="0" Grid.Column="1" IsReadOnly="True"  HorizontalAlignment="Stretch" Height="20"  Text="{Binding Path=BrowseOriginalJSFile, Mode=OneWay}" />
                    <Button Grid.Row="0" Grid.Column="2"  Content="Browse" Width="100" Height="20" Command="{Binding BrowseOriginalJSFileCommand}" />

                    <TextBlock Grid.Column="0" Grid.Row="1" HorizontalAlignment="Stretch" Height="20" Text="Web Resource"  FontWeight="Bold" />
                    <ComboBox Grid.Column="1" Grid.Row="1" ItemsSource="{Binding Path=WebResources, Mode=OneWay}" DisplayMemberPath="Name" SelectedValuePath="Value" SelectedItem="{Binding Path=SelectedWebResource,Mode=TwoWay}" FontSize="12" />
                    <Button Grid.Row="1" Grid.Column="2"  Content="Load" Width="100" Height="20" Command="{Binding LoadWebResourceCommand}" />

                </Grid>
            </StackPanel>

            <StackPanel Grid.Column="1" Grid.Row="0" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Margin="5"  >
                <Grid x:Name="SaveAsFile" HorizontalAlignment="Stretch">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="40"></RowDefinition>
                        <RowDefinition></RowDefinition>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="100"></ColumnDefinition>
                        <ColumnDefinition Width="*"></ColumnDefinition>
                        <ColumnDefinition Width="100"></ColumnDefinition>

                    </Grid.ColumnDefinitions>

                    <TextBlock Grid.Column="0" Grid.Row="0" HorizontalAlignment="Stretch" Height="20" Text="Web Resource"  FontWeight="Bold" />
                    <ComboBox Grid.Column="1" Grid.Row="0" Height="20" ItemsSource="{Binding Path=WebResources, Mode=OneWay}" DisplayMemberPath="Name" SelectedValuePath="Value" SelectedItem="{Binding Path=SelectedWebResourceForUpdate,Mode=TwoWay}" FontSize="12" />
                    <Button  Grid.Column="2" Grid.Row="0" Content="Save" Width="100" Height="20" Command="{Binding SaveWebResourceCommand}" />

                    <Button Grid.Column="2" Grid.Row="1" Content="Save As File" Width="100" Height="20" Command="{Binding SaveCRM2011JSFileCommand}" />
                </Grid>
            </StackPanel>

            <TextBlock Grid.Row="1" Grid.Column="0"  Margin="6,0,6,0" Text="Original Script" VerticalAlignment="Bottom" FontWeight="Bold" />
            <TextBlock Grid.Row="1" Grid.Column="1"  Margin="6,0,6,0" Text="Converted Script" VerticalAlignment="Bottom"  FontWeight="Bold"  />
            <TextBox Grid.Row="2" Grid.Column="0" Margin="6,0,6,6" Name="uxScript" Text="{Binding Path=JavaScriptCode, Mode=TwoWay}" VerticalScrollBarVisibility="Auto" TextWrapping="Wrap" AcceptsReturn="True" BorderThickness="2">
            </TextBox>
            <TextBox Grid.Row="2" Grid.Column="1"  Margin="6,0,6,6" Name="uxScriptConverted"  Text="{Binding Path=JavaScriptCodeConverted, Mode=TwoWay}" VerticalScrollBarVisibility="Auto" TextWrapping="Wrap" AcceptsReturn="True" BorderThickness="2">
               
            </TextBox>

        </Grid>
</toolkit:BusyIndicator>
</core:ViewBase>
